<template>
  <Modal v-model="modal" :title="title" width='600'>
    <div class="barcode-detail-modal ht400 scroll">
      <Table
          :height="options.tableHeight"
          stripe
          :border="true"
          :columns="columns"
          :data="data"
          no-data-text="亲，没有找到相关记录哦！~"></Table>
    </div>
    <div slot="footer">
        <Button @click="modal = false" size="large" type="text">取消</Button>
        <Button @click="onSave" type="primary" size="large">确认</Button>
    </div>
</Modal>
</template>
<script>
import SelectList from '@/components/SelectList';

export default {
  components: {
    SelectList,
  },
  data() {
    return {
      id: null,
      modal: false,
      id: '',
      title: '查看详情',
      options: {
        tableHeight: 400
      },
      resignBrand: '',
      brand: '',
      loading: false,
      columns: [
          {title: '商品', key: 'tiresName', align: 'left'},
          {title: '清零数量(清零库存)', key: 'quantity', align: 'left'}
      ],
      data: [],
    };
  },
  methods: {
    getDetail() {
      if(!this.id) return
      this.$ajaxGet(`/distributorInventory/listDetail/${this.id}`).then((res) => {
        this.data = res
      })
    },
    onSave(){
      this.modal=false
    },
    openModal(row) {
      this.id = row.id
      this.getDetail()
      this.modal = true;
    },
    closeModal() {
      this.modal = false;
    },
  }
}
</script>

